#include<bits/stdc++.h>
using namespace std;
struct num{
	int val;
	bool isDead=0,canAtk=1;
	int Last;
};

bool cmp(num a,num b)
{
	return a.val<b.val;
}

int n;
num a[100005];
int deadNum=0;
int LastAtk=0;
bool killCard(int x,int y)//y kill x
{
	if(x<1||x>n||y<1||y>n) return 0;
	if(a[x].val==a[y].val)
	{
		return killCard(a[x].Last,y);
	}
	if(a[x].isDead==1) return 0;
	a[x].isDead=1;
	a[y].canAtk=0;
	deadNum++;
	LastAtk=y;
	a[y].Last=a[x].Last;
	return 1;
}

int main()
{
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i].val;
		
	}
	sort(a+1,a+1+n,cmp);
	for(int i=1;i<=n;i++)
	{
		a[i].Last=i-1;
	}
	bool lalala=1;
	while(lalala)
	{
		lalala=0;
		LastAtk=0;
		for(int i=2;i<=n;i++)
		{
			if(a[i].isDead==1) continue;
			if(a[i].canAtk==0)
			{
				LastAtk=i;
				continue;
			}
			
			if(LastAtk==0)
			{
				if(a[i-1].isDead==0) 
				{
					bool bl=killCard(i-1,i);
					lalala=(bl||lalala);
				}
			}
			else
			{
				if(a[LastAtk].isDead==0) 
				{
					bool bl=killCard(LastAtk,i);
					lalala=(bl||lalala);
				}
			}
		}
	}
	cout<<n-deadNum;
	
	return 0;
}



